<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ContasPagarCreateDlg" widgetVar="ContasPagarCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateContasPagarTitle}">
            <h:form id="ContasPagarCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{contasPagarController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_id}" for="id" />
                        <p:inputText id="id" value="#{contasPagarController.selected.id}" title="#{bundle.CreateContasPagarTitle_id}" required="true" requiredMessage="#{bundle.CreateContasPagarRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_documento}" for="documento" />
                        <p:inputText id="documento" value="#{contasPagarController.selected.documento}" title="#{bundle.CreateContasPagarTitle_documento}" />
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_dataLancamento}" for="dataLancamento" />
                        <p:calendar id="dataLancamento" pattern="MM/dd/yyyy" value="#{contasPagarController.selected.dataLancamento}" title="#{bundle.EditContasPagarTitle_dataLancamento}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_dataVencimento}" for="dataVencimento" />
                        <p:calendar id="dataVencimento" pattern="MM/dd/yyyy" value="#{contasPagarController.selected.dataVencimento}" title="#{bundle.EditContasPagarTitle_dataVencimento}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_valor}" for="valor" />
                        <p:inputText id="valor" value="#{contasPagarController.selected.valor}" title="#{bundle.CreateContasPagarTitle_valor}" />
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_historico}" for="historico" />
                        <p:inputText id="historico" value="#{contasPagarController.selected.historico}" title="#{bundle.CreateContasPagarTitle_historico}" />
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_dataPagamento}" for="dataPagamento" />
                        <p:calendar id="dataPagamento" pattern="MM/dd/yyyy" value="#{contasPagarController.selected.dataPagamento}" title="#{bundle.EditContasPagarTitle_dataPagamento}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateContasPagarLabel_fornecedor}" for="fornecedor" />
                        <p:selectOneMenu id="fornecedor" value="#{contasPagarController.selected.fornecedor}" required="true" requiredMessage="#{bundle.EditContasPagarRequiredMessage_fornecedor}">
                            <f:selectItems value="#{fornecedoresController.itemsAvailableSelectOne}"
                                           var="fornecedorItem"
                                           itemValue="#{fornecedorItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{contasPagarController.create}" value="#{bundle.Save}" update="display,:ContasPagarListForm:datalist,:growl" oncomplete="handleSubmit(args,'ContasPagarCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="ContasPagarCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
